import React from 'react';
import ReactDOM from 'react-dom';
import Modal from './components/modal'
class App extends React.Component {
    state = {
      visible:true
    }
    handleOk=()=>{
      console.log("OK")
      this.setState({
        visible:false
      })
    }
    handleCancel = ()=>{
      console.log("Cancel")
      this.setState({
        visible:false
      })
    }
    render() {
        return <div className=''>
            <button onClick={()=>{this.setState({visible:true})}}>守卫</button>
            <Modal
              title="Basic Modal"
              visible={this.state.visible}
              onOk={this.handleOk}
              onCancel={this.handleCancel}
            >
              <p>Some contents...</p>
              <p>Some contents...</p>
              <p>Some contents...</p>
            </Modal>
        </div>;
    }
}

ReactDOM.render(<App/>,document.getElementById('root'))